﻿#region Copyright(c) 2006 ZO, All right reserved.
// -----------------------------------------------------------------------------
// Copyright(c) 2006 ZO, All right reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//   1.  Redistribution of source code must retain the above copyright notice,
//       this list of conditions and the following disclaimer.
//   2.  Redistribution in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//   3.  The name of the author may not be used to endorse or promote products
//       derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// -----------------------------------------------------------------------------
#endregion


#region Using directives
using System.ComponentModel;
#endregion

namespace ZO.SmartCore.Security.Cryptography
{
    /// <summary>
    /// Avaliable Hash functions cryptographic algorithms
    /// </summary>
    public enum HashAlgorithm
    {
        /// <summary>
        /// MD5 hash algorithm
        /// </summary>
        /// <remarks>
        /// Hash functions map binary strings of an arbitrary length to small 
        /// binary strings of a fixed length. A cryptographic hash function 
        /// has the property that it is computationally infeasible to find 
        /// two distinct inputs that hash to the same value; that is, hashes
        /// of two sets of data should match if the corresponding data also
        /// matches. Small changes to the data result in large unpredictable
        /// changes in the hash.
        /// The hash size for the MD5 algorithm is 128 bits.
        /// </remarks>
        [Description("System.Security.Cryptography.MD5CryptoServiceProvider")]
        MD5,

        /// <summary>
        /// Computes the SHA1 hash value for the input data using the implementation provided by the cryptographic service provider (CSP).
        /// </summary>
        /// <remarks>
        /// The hash size for the SHA1CryptoServiceProvider class is 160 bits.
        /// </remarks>
        [Description("System.Security.Cryptography.SHA1CryptoServiceProvider")]
        SHA1,

        /// <summary>
        /// Computes the SHA256 hash for the input data. 
        /// </summary>
        /// <remarks>
        /// The hash is used as a unique value of fixed size representing a 
        /// large amount of data. Hashes of two sets of data should match if 
        /// and only if the corresponding data also matches. Small changes to
        /// the data result in large unpredictable changes in the hash.
        /// The hash size for the SHA256 algorithm is 256 bits.
        /// </remarks>
        [Description("System.Security.Cryptography.SHA256Managed")]
        SHA256,

        /// <summary>
        /// Computes the SHA384 hash for the input data. 
        /// </summary>
        /// <remarks>
        /// The hash is used as a unique value of fixed size representing a 
        /// large amount of data. Hashes of two sets of data should match if 
        /// and only if the corresponding data also matches. Small changes to
        /// the data result in large unpredictable changes in the hash.
        /// The hash size for the SHA384 algorithm is 384 bits.
        /// </remarks>
        [Description("System.Security.Cryptography.SHA384Managed")]
        SHA384,

        /// <summary>
        /// Computes the SHA512  hash for the input data. 
        /// </summary>
        /// <remarks>
        /// The hash is used as a unique value of fixed size representing a 
        /// large amount of data. Hashes of two sets of data should match if 
        /// and only if the corresponding data also matches. Small changes to
        /// the data result in large unpredictable changes in the hash.
        /// The hash size for the SHA512 algorithm is 512 bits.
        /// </remarks>
        [Description("System.Security.Cryptography.SHA512Managed")]
        SHA512,

        /// <summary>
        /// Computes the RIPEMD160 hash for the input data. 
        /// </summary>
        /// <remarks>
        /// Hash functions map binary strings of an arbitrary length to small 
        /// binary strings of a fixed length. A cryptographic hash function has
        /// the property that it is computationally infeasible to find two distinct
        /// inputs that hash to the same value; that is, hashes of two sets of data 
        /// should match if the corresponding data also matches. Small changes to the 
        /// data result in large unpredictable changes in the hash.
        /// 
        /// RIPEMD-160 is a 160-bit cryptographic hash function. It is intended
        /// for use as a replacement for the 128-bit hash functions MD4, MD5,
        /// and RIPEMD. RIPEMD was developed in the framework of the EU project
        /// RIPE (RACE Integrity Primitives Evaluation, 1988-1992).
        /// </remarks>
        [Description("System.Security.Cryptography.RIPEMD160Managed")]
        RIPEMD160
    }
}
